/*
||
|| @author Alexander Brevig
|| @version 1.3
||
|| @description:
|| This class should provide an easy way to trigger functions at a set interval.
||
*/

#ifndef TIMEDACTION_H
#define TIMEDACTION_H

#include "WProgram.h"

#define NO_PREDELAY 0

class TimedAction{
  
  public:
    TimedAction(unsigned int interval,void (*function)());
    TimedAction(unsigned long prev,unsigned int interval,void (*function)());
	
	void disable();
	void enable();
	void check();

  private: 
    bool active;
    unsigned long previous;
    unsigned int interval;
    void (*execute)();
		
};

#endif

/*
|| Changelog:
||
|| 1.3 2009-04-16 - Alexander Brevig : Added disable() and enable(), requested by: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?action=viewprofile;username=ryno
|| 1.2 2009-04-16 - Alexander Brevig : Added a constructor
|| 1.1 2009-04-08 - Alexander Brevig : Added an example that demonstrates three arduino examples at once
|| 1.0 2009-03-23 - Alexander Brevig : Initial Release
*/